<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>登录</title>
<script>
  function lin() {
    var u = document.login.un.value;
    var p = document.login.pw.value;
    return u !== "" && p !== "";
  }
</script>
</head>
<body>
  <form name="login" onsubmit="return lin()">
    <label>
      身份
      <input type="text" name="un">
    </label>
    <br>
    <label>
      密码
      <input type="password" name="pw">
    </label>
    <br>
    <input type="submit" value="登录">
  </form>
</body>
</html>